In some C-like programming languages, each piece of code within the curly braces has its own scope, and the variables are not visible outside the code snippet that declares them (i.e. we cannot directly access the variables declared within the code
http://www.cnblogs.com/wolf-lifeng/p/3156936.html2.3 Global Scope 2.3.1 OverviewThe global scope is the largest namespace scope, unlike the user-defined namespace scope, where the global scope does not need to be defined, and it naturally exists in
Original article: http://blogs.msdn.com/ B /jscript/archive/2007/07/26/scope-chain-of-jscript-functions.aspx
In JavaScript, the function scope chain is hard to understand. this is because the scope chain of functions in JavaScript is far from that
In JavaScript, the scope chain of a function is a difficult thing to understand. This is because the scope chain of functions in JavaScript is far from the scope chain of functions in other languages such as C and C + +. This article explains in
(1) Scope
The scope of a variable is the region of the variable that is defined in the program's source code.
1. The lexical scope is used in JS (lexical scope)
A variable that is not declared within any function (which is also considered global
Original article Source: http://blog.csdn.net/yueguanghaidao/article/details/9568071#comments
The scope of JS has been a bit confused, and today I accidentally read the JavaScript Authority Guide, was immediately attracted to write really good. I
Each programming language, its variables have a certain range of valid, beyond this range, the variable is invalid, which is the scope of the variable. From the point of view of mathematics, it is the field of the independent variable.
Scopes are
Use functions in JS to note three points:1, when the function is invoked, it is run in the grammatical environment when he is declared;
2, the function can not run itself, it is always called by the object, the function runs, the function body of
Read "You don't know JavaScript" a book to make a note;Compiler principle:JS is a compiled language, similar to the traditional compilation language, the traditional compilation process is divided into three stages;1. Word segmentation/lexical
JS scope and scope chain details, js scope details
(1) Scope
The scope of a variable is the region of the variable defined in the program source code.
1. lexical scope is used in JS)
Variables not declared in any function (if var is omitted in the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.